# QPushButtons emit three signals: pressed, released and clicked
# The following simple code demonstrates that.


import sys
from PySide import QtGui, QtCore

class Window(QtGui.QWidget):
    def __init__(self):
        super(Window, self).__init__()
        self.setGeometry(200, 200, 350, 90)
        self.setWindowTitle("Form Layout: Dynamic Greeter")
        
        self.btn = QtGui.QPushButton(QtGui.QIcon("open.jpg"), "Button", self)
        self.btn.move(50, 50)
        self.btn.pressed.connect(self.onPressed)
        self.btn.released.connect(self.onReleased)
        self.btn.clicked.connect(self.onClicked)
    
    def onPressed(self):
        print("Pressed")
    def onReleased(self):
        print("Released")
    def onClicked(self):
        print("Clicked")
        
        
    def valueUpdate(self):
        self.lblHello.setText(self.cmbSalutation.currentText())
        self.lblResult.setText(self.ledName.text())
        
if __name__ == "__main__":
    appObject = QtGui.QApplication(sys.argv)
    ex = Window()
    ex.show()
    sys.exit(appObject.exec_())
    